<!-- html -->
<template>
    <div>
        <h1>登录</h1>
        <hr>
        <button @click="login">登录</button>
        <button @click="registered">注册</button>
    </div>
</template>

<!-- js或ts -->
<script lang="ts">
export default {
    name: 'login'
}
</script>

<!-- js或ts -->
<script setup lang="ts">
import { useRouter } from 'vue-router'

//数据
let router = useRouter()
//方法
function login() {
    router.push({
        path: '/menu'
    })
}
function registered() {
    router.push({
        path: '/login'
    })
}
</script>

<!-- 样式 -->
<style scoped></style>